package com.bop.dehong.decaifu.adapter;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.base.dehong.base.AdapterBase;
import com.bop.dehong.R;
import com.bop.dehong.info.entity.BidrecordListEntity;

@SuppressLint("InflateParams")
public class RecordListAdapter extends AdapterBase<BidrecordListEntity> {

	public RecordListAdapter(Activity context) {
		super(context);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(mContext).inflate(R.layout.record_list_items, null);
			holder.tv_cellphone = getView(convertView, R.id.record_cellphone);
			holder.tv_time = getView(convertView, R.id.record_time);
			holder.tv_money = getView(convertView, R.id.record_money);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		BidrecordListEntity entity = get(position);
		if (entity != null) {
			holder.tv_cellphone.setText(entity.getCellphone());
			holder.tv_time.setText(entity.getTime());
			holder.tv_money.setText(entity.getMoney());
		}
		return convertView;
	}

	private class ViewHolder {
		private TextView tv_cellphone;
		private TextView tv_time;
		private TextView tv_money;
	}
}
